#include "widget.h"
#include "ui_widget.h"


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    studyJournal->show();
    //set->show();
    connect(studyJournal,&StudyJournal::setBottom,[=]{
        set->show();
    });
    connect(set->colorButton,&QPushButton::clicked,[=]{
        QColor qc=QColorDialog::getColor(Qt::red,this,"颜色对话框");
        studyJournal->fontR=qc.red();
        studyJournal->fontG=qc.green();
        studyJournal->fontB=qc.blue();
    });
    connect(set->saveButton,&QPushButton::clicked,[=]{
        studyJournal->labelSize=set->sizeText->text().toInt();
        studyJournal->labelBold=set->isBold;
        studyJournal->labelItalic=set->isItalic;
        studyJournal->update();
    });

    set->transparencySlider->setValue(studyJournal->transparency);
    set->transparency=studyJournal->transparency;
    connect(set->transparencySlider,&QSlider::valueChanged,[=]{
        int value=set->transparencySlider->value();
        studyJournal->transparency=value;
        set->transparency=value;
        set->transparencySlider->setValue(value);
        set->update();
    });


}

Widget::~Widget()
{
    delete ui;
}

